/**
 * Copyright (c) 2015 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx公司,未经许可不得任意复制与传播.<br />
 *
 */
package com.smarthome.domain.enums;

/**
 * 通信类型--枚举类
 *
 */
public enum EquipmentCommTypeEnum {
	/**1：开门***/
    DO_TYPE_KM("1", "开门"),
    
    /**2：关门***/
    DO_TYPE_GM("2", "关门"),
    
    /**3：可视对讲**/
    DO_TYPE_KSDJ("3", "可视对讲"),
    
    /**4：视频预览****/
    DO_TYPE_SPYL("4", "视频预览"),
    
    /**5：视频历史***/
    DO_TYPE_SPLS("5", "视频历史");

    private String id;
    private String name;

    private EquipmentCommTypeEnum(String  id, String name) {
        this. id =  id;
        this.name = name;

    }

    public String getId() {
        return  id;
    }

    public String getName() {
        return name;
    }
    
    /**
     * 通过id，得到名称
     * @param code
     * @return
     */
    public static String getNameById(String id){
		String name = "";
		for(EquipmentCommTypeEnum e : EquipmentCommTypeEnum.values()){
			if(e.getId().equals(id)){
				name = e.getName();
				break;
			}
		}
		return name;
	}
    
    
}
